/**
 * Sensor Network Development Kit for 1-Wire Network (SeN)
 * Version : 0.1
 * Revision date : 2008-10-13
 * Author: Dubravko Penezic, dpenezic@gmail.com
 * 
 */

package utilityLib;

/**
 * AtmospericPressureTransformer class implement method to transform atmospheric pressure from one scale to another
 * Version : 0.1.1
 * Revision date : 2008-10-24
 * 
 * @author Dubravko Penezic, dpenezic@gmail.com
 *
 */

public class AtmospericPressureTransformer {

	public AtmospericPressureTransformer(){

	}

	/**
	 * fromkPatommHg method transform from kPa to mmHg	
	 * @param in
	 * @return
	 */
	public double fromkPatommHg(double in){

		return in/0.1333224;

	}

	/**
	 * frommmHgtokPa method transform from mmHg to kPa	
	 * @param in
	 * @return
	 */
	public double frommmHgtokPa(double in){

		return in*0.1333224;

	}

	/**
	 * fromkPatoinHg method transform from kPa to inHg	
	 * @param in
	 * @return
	 */
	public double fromkPatoinHg(double in){

		return in/3.386389;

	}

	/**
	 * frominHgtokPa method transform from inHg to kPa	
	 * @param in
	 * @return
	 */
	public double frominHgtokPa(double in){

		return in*3.386389;

	}

	/**
	 * fromkPatomb method transform from kPa to mb(mbar)	
	 * @param in
	 * @return
	 */
	public double fromkPatomb(double in){

		return in*10;

	}

	/**
	 * frommbtokPa method transform from mb(mbar) to kPa	
	 * @param in
	 * @return
	 */
	public double frommbtokPa(double in){

		return in/10;

	}

	/**
	 * frommmHgtoinHg method transform from mmHg to inHg	
	 * @param in
	 * @return
	 */
	public double frommmHgtoinHg(double in){

		return this.fromkPatoinHg(this.frommmHgtokPa(in));

	}

	/**
	 * frominHgtommHg method transform from inHg to mmHg	
	 * @param in
	 * @return
	 */
	public double frominHgtommHg(double in){

		return this.fromkPatommHg(this.frominHgtokPa(in));

	}

	/**
	 * frommbtommHg method transform from mb(mbar) to mmHg	
	 * @param in
	 * @return
	 */
	public double frommbtommHg(double in){

		return this.fromkPatommHg(this.frommbtokPa(in));

	}

	/**
	 * frommmHgtomb method transform from mmHg to mb(mbar)	
	 * @param in
	 * @return
	 */
	public double frommmHgtomb(double in){

		return this.fromkPatomb(this.frommmHgtokPa(in));

	}

	/**
	 * frominHgtomb method transform from inHg to mb(mbar)	
	 * @param in
	 * @return
	 */
	public double frominHgtomb(double in){

		return this.fromkPatomb(this.frominHgtokPa(in));

	}

	/**
	 * frommbtoinHg method transform from mb(mbar) to inHg	
	 * @param in
	 * @return
	 */
	public double frommbtoinHg(double in){

		return this.fromkPatoinHg(this.frommbtokPa(in));

	}

}
